--------------------------------------------------------------
-- Archivo: inst_memory.vhd
-- Fecha de creacion: 14/01/2011
-- Ultima fecha de modificacion: 05/02/2011
-- Disenador: Omar Diaz
-- Diseno: inst_memory. Memoria de instruccion 64*12 (modelo ROM)
-- Proposito: Almacena las instrucciones que serán ejecutadas por
-- 			  por el procesador
--------------------------------------------------------------

library ieee;
use ieee.std_logic_1164.all;

entity inst_memory is
	port(	
		RESET_i   : in  std_logic;
		ADDRESS_i : in  std_logic_vector(5 downto 0);
		DATA_o    : out std_logic_vector(11 downto 0)
	);
end inst_memory;

--------------------------------------------------------------

architecture behavioral of inst_memory is
	signal rom_content : std_logic_vector(11 downto 0);

begin

    process(RESET_i, rom_content)
    begin
    	if(RESET_i = '0') then
    		DATA_o <= rom_content;
		else
    		DATA_o <= "ZZZZZZZZZZZZ";
        end if;
    end process;
    
    with ADDRESS_i select
        rom_content <= 
            B"101000000000" when B"000000",
            B"101001000000" when B"000001",
            B"101010000000" when B"000010",
            B"101011000000" when B"000011",
            B"100010001100" when B"000100",
            B"100111011010" when B"000101",		-- Aqui va el programa 
            B"010000101100" when B"000110",		-- que se va a ejecutar
            B"010101101110" when B"000111",
            B"011010000101" when B"001000",
            B"011111000111" when B"001001", 
            B"101000011000" when B"001010",
            B"000011111000" when B"001011",
            B"000101010000" when B"001100",
            B"111100001100" when B"001101",
            B"110001110000" when B"001110",
            B"110100110000" when B"001111",
            B"000000001100" when B"010000",
            B"000000001101" when B"010001",
            B"000000001110" when B"010010",
            B"000000001111" when others;

end behavioral;

--------------------------------------------------------------

